package cn.jtcoding.web.framework.annotation;

import java.lang.annotation.*;

/**
 * @author jason.tang
 * @date 2021/4/9 9:00
 * @desc 保证API幂等性注解
 */
@Target({ ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Idempotent {

    String PREFIX = "LEARNING.IDEMPOTENT:";

    /**
     * Key的prefix
     */
    String prefix() default PREFIX;

    /**
     * 时间段，单位为秒，默认值-1
     */
    long period() default 10;

    /**
     * Key缓存参数的分隔符
     */
    String delimiter() default "|";
}
